package cn.orgcloud.ribbon_consumer.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @description:
 * @author：zhongyu
 * @create：2018-08-21 16:44
 **/

@RestController
public class ConsumerController {

    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("hello")
    public  String consumerHello(){

        return restTemplate.getForEntity("http://service1:2601/hello", String.class).getBody();
    }
}
